package com.example.imtoken.modules.user.create.backups.mnemonic.confirmation

import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.example.imtoken.R
import com.example.imtoken.databinding.ItemMnemonicsTxtBinding
import com.example.imtoken.entitys.app.ItemWordsEntity

class ConfirmationMnemonicsAdapter(layoutResId: Int) :
    BaseQuickAdapter<ItemWordsEntity, BaseDataBindingHolder<ItemMnemonicsTxtBinding>>(layoutResId) {
    override fun convert(
        holder: BaseDataBindingHolder<ItemMnemonicsTxtBinding>,
        item: ItemWordsEntity
    ) {
        holder.dataBinding?.item = item
        if (item.isSelect) {
            holder.dataBinding?.constraintLayout3?.setBackgroundResource(R.drawable.shape_item_mnemonics_bg_true)
            holder.dataBinding?.tvWord?.setTextColor(
                ContextCompat.getColor(
                    context,
                    R.color.createBtnBg
                )
            )
        } else {
            holder.dataBinding?.constraintLayout3?.setBackgroundResource(R.drawable.shape_item_mnemonics_bg_false)
            holder.dataBinding?.tvWord?.setTextColor(ContextCompat.getColor(context, R.color.black))
        }
    }
}